package com.atguigu.mock.entity;

import com.atguigu.common.base.entity.AutoIdBase;
import com.atguigu.common.comment.Comment;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import javax.persistence.Entity;
import javax.persistence.OneToOne;
import java.math.BigDecimal;
import java.time.LocalDateTime;

@Entity
@Getter
@Setter
@NoArgsConstructor
@Comment(value = "批复表")
public class Reply extends AutoIdBase {
    @Comment(value = "关联授信申请")
    @OneToOne(optional = false)
    private CreditFacility creditFacility;
    @Comment(value = "批复授信金额")
    private BigDecimal creditAmount;

    @Comment("还款期数")
    private int period;

    @Comment("还款利率")
    private BigDecimal irr;

    public Reply(LocalDateTime createTime, CreditFacility creditFacility, BigDecimal creditAmount, int period, BigDecimal irr) {
        super(createTime);
        this.creditFacility = creditFacility;
        this.creditAmount = creditAmount;
        this.period = period;
        this.irr = irr;
    }
}
